<%-- 
    Document   : formPredeterminado
    Created on : 18/06/2013, 01:02:56 PM
    Author     : Neto
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>COMPRA</title>

        <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/resources/dhtmlxSuite/dhtmlxForm/codebase/skins/dhtmlxform_dhx_skyblue.css">
        <script src="${pageContext.request.contextPath}/resources/dhtmlxSuite/dhtmlxForm/codebase/dhtmlxcommon.js"></script>
        <script src="${pageContext.request.contextPath}/resources/dhtmlxSuite/dhtmlxForm/codebase/dhtmlxform.js"></script>


    </head>
    <body>
         <div id="myForm" style="width:600px; height:270px; margin-left: 360px;"></div> 
        <script>
            var myForm,
                    formData;

            formData = [{
                    type: "settings",
                    position: "label-left",
                    labelWidth: 130,
                    inputWidth: 120
                }, {
                    type: "fieldset",
                    label: "HOLA",
                    inputWidth: "auto",
                    list: [
                        {
                            type: "input",
                            label: "Nombre",
                            name: "nombre",
                            value: "",
                            required: true
                        },
                        {
                            type: "input",
                            label: "Precio Unitario",
                            name: "PrecioUnitario",
                            value: "",
                            required: true
                        },
                        {
                            type: "input",
                            label: "Cantidad",
                            name: "cantidad",
                            value: "",
                            required: true
                        }, {
                            type: "select",
                            name: "Cantidad2",
                            label: "Cantidad2",
                            options: [{
                                    value: "C1",
                                    text: "1"
                                }, {
                                    value: "C2",
                                    text: "2"
                                }, {
                                    value: "C3",
                                    text: "3"
                                }, {
                                    value: "C4",
                                    text: "4",
                                    selected: true
                                }]}, {
                            type: "input",
                            label: "Total",
                            name: "total",
                            value: "",
                            required: true
                        }, {
                            type: "button",
                            name: "comprar",
                            value: "Comprar"
                        }]
                }];

            myForm = new dhtmlXForm("myForm", formData);
            //myForm.enableLiveValidation(true);
            //myForm.attachEvent("onButtonClick", function(id) {
            //if(id=="guardar"){


            // if(myForm.validate()){
            //myForm.send("insertemp","post"); 
            // }

            // }
            // });

        </script>
    </body>
</html>
